package models.players;

import java.io.File;
import java.util.*;

import models.cards.IPlayerCard;
import models.city.City;
import models.game.Game;

public class Player {

	private final String username;
	private int turnIndex;
	private String rolename;
	private City location;
	private HashMap<String, IPlayerCard> hand;
	private File pawnImage;
	private Game game;
	private String sessionId;

	public Player(String username, int turnIndex, String sessionId) {
		this.username = username;
		this.rolename = getClass().getSimpleName();
		this.turnIndex = turnIndex;
		this.hand = new HashMap<String, IPlayerCard>();
		this.sessionId = sessionId;
	}
	
	public String getSessionId() {
		return sessionId;
	}
	
	public void setGame(Game game) {
		this.game = game;
	}
	
	public Game getGame() {
		return game;
	}

	public HashMap<String, IPlayerCard> getHand() {
		return hand;
	}

	public void putCardInHand(IPlayerCard card) {
		this.hand.put(card.getName(), card);
	}

	public void removeCardFromHand(IPlayerCard card) {
		this.hand.remove(card.getName());
	}

	public City getLocation() {
		return location;
	}

	public void setLocation(City location) {
		this.location = location;
	}

	public String getUsername() {
		return username;
	}

	public int getTurnIndex() {
		return turnIndex;
	}
	public void setTurnIndex(int turnIndex) {
		this.turnIndex = turnIndex;
	}
	public void decreaseTurnIndex() {
		this.turnIndex--;
	}
}
